<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>js对象</title>
		<script>
			/*2.自定义对象 方式2*/	
			var c2={
				brand:"audi",
				color:"white",
				fly:function(){
					console.log(this.color+this.brand+"起飞了");
				}
			}
			c2.fly();
			console.log(c2);
			var s1={
				name:"小明",
				age:10,
				study:function(){
					console.log(this.age+"岁的"+this.name+"好好学习,天天向上");
				}
			}
			console.log(s1.name);
			console.log(s1.age)
			s1.study();
			/*2.自定义对象 方式1*/
			//生命对象
			//创建对象
			function People(){};
			var p=new People();
			p.name="老王";
			p.age=23;
			p.address="济南山大路达内";
			p.tel=1371111111;
			console.log(typeof p.tel);
			console.log(p.name)
			console.log(p);
			p.run=function(){window.document.write("跑起来")};
			p.run();
			p.zhuangB=function(){window.document.write("装逼就让你飞起来")};
			p.zhuangB();
			p.fly=function(){window.alert("真的飞起来了")};
			p.fly();
			window.onload=function(){
				console.log(typeof 100);
			}
			//确认框
			window.confirm("确认");
			//弹出框
			window.alert("提示对话框");
			//输入框
			// window.prompt("输入点东西");
			var a=prompt("输入数字")
			console.log(typeof a);
			var b=parseInt(a);
			console.log(b);
			// window.event;
			// window.document返回document对象,代表整个网页文件.
			// window.document.write("hello JS");
			// window.document.getElementById();
			// window.document.getElementsByTagName();
			// window.document.getElementsByClassName();
			// window.document.getElementsByName();
		</script>
	</head>
	<body>
	</body>
</html>
